package com.atguigu.jxc.controller;

import com.atguigu.jxc.domain.ServiceVO;
import com.atguigu.jxc.entity.OverflowList;
import com.atguigu.jxc.service.OverflowListGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author 杨林
 * @create 2023-01-29 18:05 星期日
 * description:
 */
@RestController
@RequestMapping("/overflowListGoods")
public class OverflowListGoodsController {

    @Autowired
    OverflowListGoodsService overflowListGoodsService;


    /**
     * 新增报溢单
     * @param overflowList
     * @param overflowListGoodsStr
     * @return
     */
    @PostMapping("/save")
    public ServiceVO save(OverflowList overflowList, String overflowListGoodsStr){

        return overflowListGoodsService.save(overflowList,overflowListGoodsStr);
    }


    /**
     * 报溢单查询
     * @return
     */
    @PostMapping("/list")
    public Map<String,Object> list(String  sTime, String  eTime){

        return overflowListGoodsService.list(sTime,eTime);
    }

    /**
     * 报溢单商品信息
     * @return
     */
    @PostMapping("/goodsList")
    public Map<String,Object> goodsList(Integer overflowListId){

        return overflowListGoodsService.goodsList(overflowListId);
    }
}
